1. Field of the Invention
The present invention relates to an image processing method and apparatus which add information to digital image data without causing considerable damage thereto, and to a storage medium therefor.
2. Description of the Related Art
Hitherto, regarding electronic watermark technologies, various methods have been developed as methods for protecting the copyright of digital content. These methods have attracted attention as security and copyright protection technologies in the electronic distribution industry, in which handling information of digital content, such as the name of the owner of the copyright and the identification (ID) of the purchaser, is embedded in the digital information of the image in such a manner as to be difficult for the human eye to see, making it possible to track unauthorized use of illegal copies.
In these electronic watermark technologies, various methods have been proposed as methods for embedding data. As one of the methods, there is a method for embedding information in the least significant bit of the digital image data. In this method, bits are embedded in digitized image data X (or the spatial-frequency data thereof), and when 1-bit information (0 or 1) is embedded in the image data, the least significant bit (LSB) of the image data is changed according to whether the information to be embedded is 0 or 1. For example, when the image data is the decimal value 101, the binary representation thereof is the image data (1100101). When it is determined in advance that when the value to be embedded is xe2x80x9c0xe2x80x9d, the LSB is set to 0, and when the value to be embedded is xe2x80x9c1xe2x80x9d, the LSB is set to 1, the watermark information is embedded in the LSB of the image data. More specifically, when embedding information xe2x80x9c0xe2x80x9d and xe2x80x9c1xe2x80x9d, the image data become (1100100) and (1100101), respectively. Such embedded information is obtained by reading these image data and by extracting the LSB. Although this method is simple, the embedded information may be lost when an error is mixed into the image data and when image processing is performed on the image data. For example, when 1-bit error information is added to the image data, the information embedded in the LSB is directly affected. Also, when gray-scale processing, for example, gamma conversion, is performed on the image, the LSB value is often varied. In other words, embedded information can be easily removed or changed by this processing, that is, this method is said to be weak in tolerance for practical use.
In order to solve this problem, there is a method for causing image data to have strong tolerance by requantizing the image data. Referring to FIG. 1, a description is given of such a method which requantizes image data X, by an incremental amount defined as width h, at a specified place. More specifically, referring to FIG. 1, the image data X is assumed to be divided into steps of width h. If the image data is assumed to be the decimal value 101 and the width h is assumed to be 4, the image data can be 4, 8, 12, 16 . . . , 100, 104, and so on. Candidates for requantizing the value 101 of the image data are therefore 100 and 104. Accordingly, the rule described below is applied.
When embedding information xe2x80x9c0xe2x80x9d, quantization is performed to an even-numbered requantization value.
When embedding information xe2x80x9c1xe2x80x9d, quantization is performed to an odd-numbered requantization value. The requantization value 100 is odd-numbered at 4xc3x9725 and the requantization value 104 is even-numbered at 4xc3x9726. Therefore, since quantization is performed to an even-numbered value when the embedding information is xe2x80x9c0xe2x80x9d, in accordance with the above-described rule, the value is requantized to 104, and since quantization is performed to an odd-numbered value when the embedding information is xe2x80x9c1xe2x80x9d, the value is requantized to 100.
In order to detect the embedded information using the above-described requantization method, the requantized image data is divided by width h in order to obtain a quotient.
Accordingly, the embedded information is detected by using a rule (2) which satisfies the following two conditions: when the quotient is an odd number the embedding information is xe2x80x9c1xe2x80x9d, and when the quotient is an even number the embedding information is xe2x80x9c0xe2x80x9d. For example, when image data are 100 and 104, by dividing such data by width 4, the following are obtained:
Since 100/4=25 is an odd number, the embedding information is xe2x80x9c1xe2x80x9d, and since 104/4=26 is an even number, the embedding information is xe2x80x9c0xe2x80x9d.
Here, if the width h for requantization is set to be larger, error tolerance is improved. For example, if 1-bit error information is mixed into the image data after requantization, the data 100 becomes 101 or 99, and the data 104 becomes 105 or 103.
Accordingly, the rule (2) is changed as described below to a rule (3) which satisfies the following two conditions:
If the quotient in round figures is an odd number, the embedding information is xe2x80x9c1xe2x80x9d.
If the quotient in round figures is an even number, the embedding information is xe2x80x9c0xe2x80x9d.
Using the above rule (3), by dividing the read image data by width 4, the following can be obtained:
Since the values [101/4]=25 and [99/4]=25 are odd numbers, the embedding information is xe2x80x9c1xe2x80x9d.
Since the values [105/4]=26 and [103/4]=26 are even numbers, the embedding information is xe2x80x9c0xe2x80x9d. Therefore, it is possible to obtain watermark information having strong error tolerance. Here, the width h for requantization can be used differently as a parameter which provides the intensity of error tolerance according to the intended use. Since the same value must be used during embedding and during detection, the value of the width h is managed as key information.
In such a method, by varying the width h, embedding with strong tolerance is possible. However, such a method has the following problems.
(1) If the width h is set to be larger, the tolerance is improved but image quality deteriorates.
(2) If the width h is set to be smaller, image quality is improved but the tolerance deteriorates.
Therefore, image quality and tolerance are in a trade-off relationship; if one of them is improved, the other deteriorates, and it is not possible to improve both.
It is an object of the present invention to solve the above-described problems.
It is another object of the present invention to embed information in such a manner that deterioration in image quality is small.
It is a further object of the present invention to provide an image processing method and apparatus which are suitable for detecting embedded information with high accuracy, and a storage medium therefor.
It is a still further object of the present invention to provide an information embedding method having high tolerance.
It is a still further object of the present invention to provide an information embedding method having novel functions, and a storage medium therefor.
To achieve the above-mentioned objects, according to one aspect of the present invention, there is provided an image processing method for embedding additional information into image data, the image processing method comprising the steps of: providing a plurality of pixels or a plurality of spatial-frequency components into which additional information is to be embedded; and changing the data value of the plurality of embedding pixels or spatial-frequency components in accordance with a value corresponding to the data value of the plurality of embedding pixels or spatial-frequency components in order to embed the additional information.
According to another aspect of the present invention, there is provided an image processing method in which a spatial area or a spatial-frequency area of image data is divided into a determination area and an embedding area, and information is embedded only in the embedding area which is regarded as an area in which deterioration in image quality is small on the basis of the determination result of the determination area. In such a method, by adaptively performing an embedding operation according to the image quality, deterioration can be reduced and tolerance can be improved. Such a method is simple, exhibits a small deterioration in image quality and has excellent tolerance, and since the amount of features of an image are extracted and information is embedded according to that amount, individual embedded position information need not be passed during detection.
The above and further objects, aspects and novel features of the invention will become more apparent from the following detailed description when read in connection with the accompanying drawings.